package com.future.serviceImpl;

import com.future.dto.StudentForRoomDto;
import com.future.dto.UserForManagerDto;
import com.future.dto.UserRoleStatusDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.future.mapper.UserinfoMapper;
import com.future.domain.Userinfo;
import com.future.service.UserinfoService;
/**
 * @Auther: 田坑坑
 * @Date: 2022/6/20 14:01
 * @Description:  我题序等你回
 */
@Service
public class UserinfoServiceImpl extends ServiceImpl<UserinfoMapper, Userinfo> implements UserinfoService{


    @Autowired
    UserinfoMapper userinfoMapper;

    @Override
    public List<UserForManagerDto> userForManager() {
        return this.userinfoMapper.userForManager();
    }

    @Override
    public List<StudentForRoomDto> studentForRoom() {
        return this.userinfoMapper.studentForRoom();
    }

    //根据 学生用户编号 查询 学生寄宿状态
    @Override
    public UserRoleStatusDto findRoleStatus(int userId) {
        return this.userinfoMapper.SelectStudentUserRoleStatusByUserId(userId);
    }

    @Override
    public int updateBatch(List<Userinfo> list) {
        return baseMapper.updateBatch(list);
    }
    @Override
    public int updateBatchSelective(List<Userinfo> list) {
        return baseMapper.updateBatchSelective(list);
    }
    @Override
    public int batchInsert(List<Userinfo> list) {
        return baseMapper.batchInsert(list);
    }
}
